﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace UFIDA.U9.Cust.SH.SHSOListBListUIModel
{
	[Serializable]
	public partial class SHSOListBListUIModelModel : UIModel
	{
		#region Constructor
		public SHSOListBListUIModelModel() : base("SHSOListBListUIModel")
		{
			InitClass();
			this.SetResourceInfo("3e063f0d-e810-4ebe-8ce6-1c4a929ef651");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private SHSOListBListUIModelModel(bool isInit) : base("SHSOListBListUIModel")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new SHSOListBListUIModelModel(false);
		}
		#endregion
		#region member
		#region views
		private SOShiplineView viewSOShipline;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public SOShiplineView SOShipline
		{
			get { return (SOShiplineView)this["SOShipline"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewSOShipline = new SOShiplineView(this);
			this.viewSOShipline.SetResourceInfo("98b2f7fb-85c8-468a-9d61-e5ceeb1720c0");
			this.Views.Add(this.viewSOShipline);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.SH.SHFastShipUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class SOShiplineView : UIView
	{
		#region Constructor
		public SOShiplineView(IUIModel model) : base(model,"SOShipline","UFIDA.U9.SM.SO.SOShipline", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private SOShiplineView():base(null,"SOShipline","UFIDA.U9.SM.SO.SOShipline", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new SOShiplineView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldSOLine
		{
			get { return this.Fields["SOLine"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public SOShiplineDefaultFilterFilter DefaultFilter
		{
			get { return (SOShiplineDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","c3dba360-6493-49b0-a102-c94c96207f59");
			UIModelRuntimeFactory.AddNewUIField(this,"SOLine", typeof(Int64), false,"","UFIDA.U9.SM.SO.SOLine", "SOLine", true,true, false, "",false,(UIFieldType)4,"c9b1049e-d8a4-429a-b35a-8fd6a3e47add","1083463d-b2a1-4dc0-986f-8419ad9cbc8b");


			this.CurrentFilter = new SOShiplineDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new SOShiplineRecord(builder);
		}
		#endregion

		#region new method
		public new SOShiplineRecord FocusedRecord
		{
			get { return (SOShiplineRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new SOShiplineRecord AddNewUIRecord()
		{	
			return (SOShiplineRecord)base.AddNewUIRecord();
		}
		public new SOShiplineRecord NewUIRecord()
		{	
			return (SOShiplineRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class SOShiplineRecord : UIRecord
	{
		#region Constructor
		public SOShiplineRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private SOShiplineView uiviewSOShipline
		{
			get { return (SOShiplineView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new SOShiplineRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewSOShipline.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewSOShipline.FieldID);
			}
			set{
				this[this.uiviewSOShipline.FieldID] = value;
			}
		}
		
		
		public  Int64 SOLine
		{
			get{
				//object value = this[this.uiviewSOShipline.FieldSOLine] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewSOShipline.FieldSOLine);
			}
			set{
				this[this.uiviewSOShipline.FieldSOLine] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class SOShiplineDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public SOShiplineDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private SOShiplineDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new SOShiplineDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}